package com.lsk.serviceprice.controller;

import com.lsk.internalcommon.DTO.ResponseResult;
import com.lsk.internalcommon.request.ForecastPriceDTO;
import com.lsk.internalcommon.response.ForecastPriceResponse;
import com.lsk.serviceprice.service.ForecastPriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ForecastPriceController {
    @Autowired
    private ForecastPriceService forecastPriceService;

    @PostMapping("/forecast-price")
    public ResponseResult<ForecastPriceResponse> forecastPrice(@RequestBody ForecastPriceDTO forecastPriceDTO){
        String deplongitude = forecastPriceDTO.getDeplongitude();
        String deplatitude = forecastPriceDTO.getDeplatitude();
        String destlongitude = forecastPriceDTO.getDestlongitude();
        String destlatitude = forecastPriceDTO.getDestlatitude();
        String cityCode = forecastPriceDTO.getCityCode();
        String vehicleType = forecastPriceDTO.getVehicleType();

        return forecastPriceService.forecastPrice(deplongitude,deplatitude,destlongitude,destlatitude,cityCode,vehicleType);
    }
}
